% function plot_bisection

v2 = [-1 0]; v3 = [1 0]; v1 = [0 1];

v4 = (v2+v3)/2;
v5 = (v1+v3)/2;
v6 = (v2+v1)/2;

figure('Position',[100,100 900,150]);

% treat case 1:
subplot(1,4,1);
plot([v1(1) v2(1) v3(1) v1(1)],[v1(2) v2(2) v3(2) v1(2)]);
hold on; plot([v1(1) v4(1)],[v1(2) v4(2)],'r--'); axis equal;axis off; hold off;


% treat case 2:
subplot(1,4,2);
plot([v1(1) v2(1) v3(1) v1(1)],[v1(2) v2(2) v3(2) v1(2)]);
hold on; plot([v1(1) v4(1) v5(1)],[v1(2) v4(2) v5(2)],'r--'); axis equal;axis off; hold off;


% treat case 3:
subplot(1,4,3);
plot([v1(1) v2(1) v3(1) v1(1)],[v1(2) v2(2) v3(2) v1(2)]);
hold on; plot([v1(1) v4(1) v6(1)],[v1(2) v4(2) v6(2)],'r--'); axis equal;axis off; hold off;


% treat case 4:
subplot(1,4,4);
plot([v1(1) v2(1) v3(1) v1(1)],[v1(2) v2(2) v3(2) v1(2)]);
hold on; plot([v1(1) v4(1) v6(1)],[v1(2) v4(2) v6(2)],'r--'); 
plot([v4(1) v5(1)],[v4(2) v5(2)],'r--');axis equal;axis off; hold off;
